import mongoose from 'mongoose'

const projectSchema = new mongoose.Schema({
  title: {
    type: String,
    required: true
  },
  code: {
    type: String,
    required: true
  },
  manager: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'project-manager',
    required: false,
  },
  comment: {
    type: String,
    required: false
  },
  boardLink: {
    type: String,
    required: false
  },
  from: {
    type: Date,
    required: true,
  },
  to: {
    type: Date,
    required: true,
  },
  isActive: {
    type: Boolean,
    required: true,
  },
  config: {
    type: Object,
    required: false,
  },
  responsibleEmployee: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'employee',
    required: false,
  }
})

export default mongoose.model('project', projectSchema)
